import axios from 'axios';
import { loginreq, req } from './axiosFun';

/**
 * 场地管理
 **/
// 获取场地
export const List = (page, pagesize, parentId) => { return req("get", "/api/field/?page=" + page + "&pagesize=" + pagesize + "&parentId=" + (parentId ? -1 : parentId)) };
// 删除场地
export const Delete = (id) => { return req("post", "/api/field/delete", { id: id }) };
// 添加场地
export const Add = (form) => { return req("post", "/api/field/add", JSON.stringify(form)) };
// 更新场地
export const Update = (form) => { return req("post", "/api/field/update", JSON.stringify(form)) };
// 获取树
export const Tree = (page, pagesize) => { return req("get", "/api/field/tree") };
// 场地映射表
export const Options = () => { return req("get", "/api/field/options") }